#ifndef __FF_PORT_H_
#define __FF_PORT_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "system.h"
#include "ff.h"
#include "diskio.h"


typedef struct 
{
    const char *name;
    DSTATUS (*init)(void);
    DSTATUS (*deinit)(void);
    DSTATUS (*status)(void);
    DRESULT (*read)(BYTE *buff, DWORD sector, UINT count);
    DRESULT (*write)(const BYTE *buff, DWORD sector, UINT count);
    DRESULT (*ioctl)(BYTE cmd, void *buff);
} _ff_port_opt_t;


/* export func */

void ff_mem_free(void *ptr);
void *ff_mem_malloc(unsigned int bytes);

int disk_get_vol_by_name(const char *name);


#ifdef __cplusplus
}
#endif

#endif // __FF_PORT_H_

